import Cookies from 'js-cookie'
import Store2 from 'store'

const TokenKey = 'ab_token'
const UserInfoKey = 'ab_user_info'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setUserInfo(userInfo) {
  return Store2.set(UserInfoKey, userInfo)
}

export function getUserInfo() {
  return Store2.get(UserInfoKey)
}

export function LogOutRemoveAll() {
  removeToken()
  Store2.remove()
}
